import { IAbility, IContext, IParam, IUIActionResult } from "@/core";
{{#if appPlugin.code3}}
    {{appPlugin.code3}}
{{/if}}
/**
 * {{appPlugin.name}}插件类
 *
 * @export
 * @class {{pascalCase appPlugin.pluginCode}}
 */
export default class {{pascalCase appPlugin.pluginCode}} {

    /**
     * 当前插件所属数据服务
     * 
     * @memberof {{pascalCase appPlugin.pluginCode}}
     */
    private dataService:any;

    /**
     * Creates an instance of {{pascalCase appPlugin.pluginCode}}.
     * @param {IParam} opts
     * @memberof {{pascalCase appPlugin.pluginCode}}
     */
    public constructor(opts:IParam){
        this.dataService = opts;
    }

{{#if appPlugin.code2}}
    {{appPlugin.code2}}
{{/if}}

    /**
     * @description 执行界面行为
     * @param {IContext} context
     * @param {IParam} viewParams
     * @param {IParam[]} data
     * @param {MouseEvent} event
     * @param {IAbility} ability
     * @return {*}  {Promise<IUIActionResult>}
     * @memberof {{pascalCase appPlugin.pluginCode}}
     */
    public async execute(context: IContext = {}, data: IParam | IParam[]): Promise<any> {
        {{#if appPlugin.code}}
        {{appPlugin.code}}
        {{else}}
        throw new Error("应用实体方法插件内容暂未实现");
        {{/if}}
    }

}

